# -*- coding:utf-8 -*-
import xadmin

from .models import Topic, TopicReply, CommunityBanner


class TopicAdmin(object):
    list_display = ['title', 'user', 'add_time']
    search_fields = ['title', 'user', 'add_time']
    list_filter = ['title', 'user', 'add_time']


class TopicReplyAdmin(object):
    list_display = ['topic', 'user', 'add_time']
    search_fields = ['topic', 'user', 'add_time']
    list_filter = ['topic', 'user', 'add_time']


class CommunityBannerAdmin(object):
    list_display = ['title', 'index']


xadmin.site.register(Topic, TopicAdmin)
xadmin.site.register(TopicReply, TopicReplyAdmin)
xadmin.site.register(CommunityBanner, CommunityBannerAdmin)